<%@page import="study.itwill.team5.exchange.ExchangeRateItem"%>
<%@page import="study.itwill.team5.exchange.ExchangeRate"%>
<%@page import="study.itwill.team5.admin.AdminItem"%>
<%@page import="study.itwill.jsp.WebHandler"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%@ include file="../session.jsp"%>
<%@ include file="../dbcon.jsp"%>
<%
	ArrayList<ExchangeRateItem> list = ExchangeRate.getList();
%>
<!DOCTYPE html>
<html lang="ko">
  <head>
	<%@ include file="../head.jsp"%>
  </head>
  <body>
  	<%@ include file="../menu.jsp"%>
	<div class="container">
	
		<div class="page-header">
			<h1>환율정보</h1>
		</div>
		
		<div class="table-responsive">
			<table class="table table-striped table-hover">
				<thead>
					<tr class="warning row">
						<th class="text-center col-md-2">나라</th>
						<th class="text-center col-md-2">기준 환율</th>
						<th class="text-center col-md-2">살때 환율</th>
						<th class="text-center col-md-2">팔때 환율</th>
						<th class="text-center col-md-1">송금 보낼때</th>
						<th class="text-center col-md-1">송금 받을때</th>
						<th class="text-center col-md-1">화폐 단위</th>
						<th class="text-center col-md-1">변동률</th>
					</tr>
				</thead>
				<tbody>
					<%
					if (list.size() < 1) {
				%>
					<tr>
						<td colspan="9">
							<p class="text-center text-warning" style="height: 100px">
								저장된 데이터가 없습니다.</p>
						</td>
					</tr>
					<%
					} else {
						for(int i=0; i<list.size(); i++) {
							ExchangeRateItem item = list.get(i);
				%>
					<tr class="text-center row">
						<td class="col-md-2"><%=item.getHname()%></td>
						<td class="col-md-2"><%=item.getStandard()%></td>
						<td class="col-md-2"><%=item.getBuy()%></td>
						<td class="col-md-2"><%=item.getSell()%></td>
						<td class="col-md-1"><%=item.getSend()%></td>
						<td class="col-md-1"><%=item.getReceive()%></td>
						<td class="col-md-1"><%=item.getSign()%></td>
						<td class="col-md-1"><%=item.getChangeVal()%></td>
						
					</tr>
					<%
						}
					}
				%>
				</tbody>
			</table>
		</div>
		
	</div>
	<% db.disconnect(); %>
	<!-- Javascript -->
	<script src="/Team-Project/assets/js/jquery.js"></script>
	<script src="/Team-Project/assets/js/bootstrap.min.js"></script>
  </body>
</html>